Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't force module output when targeting ES6 #140

Merged
merged 2 commits into from
Jan 20, 2016
Merged

Conversation

jbrantly
Copy link
Member

This PR cleans up module defaults and target handling and fixes #111 and #132

Previously the module output was defaulted to CommonJS except in the case where the target was set to ES6, in which case the module output was forced to "None". This worked well in TS 1.6 but causes problems in TS 1.7+ because it's impossible to configure ts-loader to target: es6 and module: commonjs.

The new behavior is as follows:

  • Default to CommonJS ONLY if target is NOT es6. This is a breaking change, but causes ts-loader to behave a little more like tsc (in that if you specify a target: es6 but not module the output is es6 modules) and also will eventually provide a better default experience when webpack2 hits.
  • If using TS 1.6, revert to the old behavior of forcing module: none if target: es6

Additionally this PR cleans up default lib handling (#67) and fixes a test based on a change in the nightly.

jbrantly added a commit that referenced this pull request Jan 20, 2016
Don't force module output when targeting ES6
@jbrantly jbrantly merged commit 57c813e into master Jan 20, 2016
@johnnyreilly johnnyreilly deleted the dont-force-module branch July 13, 2017 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impossible to emit CommonJS modules when targeting ES6
1 participant